package a0.commonAPI.compara.comparable;

import org.junit.Test;

import java.util.Arrays;

public class MyTest {

    @Test
    public void test() {
        Dog d1 = new Dog("xiaogou", 2);
        Dog d2 = new Dog("xiaogou", 7);
        Dog d3 = new Dog("xiaogou", 9);
        Dog d4 = new Dog("xiaogou", 5);

        Dog[] dogs = {d1, d2, d3, d4};
        for (Dog dog : dogs) {
            System.out.println(dog.toString());
        }

        Arrays.sort(dogs);

        for (Dog dog : dogs) {
            System.out.println(dog.toString());
        }


    }

}
